import {
  Column,
  CreateDateColumn,
  Entity,
  JoinColumn,
  OneToOne,
  PrimaryGeneratedColumn,
} from 'typeorm';
import { Booking } from './booking.entity';

@Entity()
export class BookingAudit {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  manager_id: number;

  @OneToOne(() => Booking)
  @JoinColumn({ name: 'booking_id' })
  booking: Booking;

  @Column({ type: 'bigint' })
  audit_time: number;

  @Column({ type: 'boolean', comment: '审核结果(通过/拒绝)' })
  result: boolean;

  @Column({ comment: '拒绝原因', nullable: true })
  reason: string;

  @CreateDateColumn()
  created_at: Date;
}
